package com.example.room_type.service.impl;

import com.example.model.room_type.PriceRule;
import com.example.room_type.mapper.PriceRuleMapper;
import com.example.room_type.service.PriceRuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PriceRuleServiceImpl implements PriceRuleService {

    @Autowired
    private PriceRuleMapper priceRuleMapper;

    @Override
    public int insert(PriceRule priceRule) {
        return priceRuleMapper.insert(priceRule);
    }

    @Override
    public PriceRule get(Long id) {
        return priceRuleMapper.get(id);
    }

    @Override
    public List<PriceRule> list(PriceRule priceRule) {
        return priceRuleMapper.list(priceRule);
    }

    @Override
    public int update(PriceRule priceRule) {
        return priceRuleMapper.update(priceRule);
    }

    @Override
    public int delete(Long id) {
        return priceRuleMapper.delete(id);
    }

    @Override
    public List<PriceRule> getByRoomTypeId(Long roomTypeId) {
        return priceRuleMapper.getPriceRuleByRoomType(roomTypeId);
    }
}
